/**
 * 
 */
package com.wgo.precise.client.ui.model;

import java.util.ArrayList;
import java.util.List;

import com.wgo.precise.client.ui.model.facade.DNDTarget;
import com.wgo.precise.client.ui.model.facade.IPropertiesContainer;
import com.wgo.precise.client.ui.model.facade.ModelSystem;
import com.wgo.precise.client.ui.view.projecttree.CreateProjectAction;
import com.wgo.precise.client.ui.view.util.ViewerAction;
import com.wgo.precise.common.VO.RequirementSystem;

/**
 * @author petterei
 *
 * @version $Id: RootProjectSystemWrapper.java,v 1.1 2006-01-30 21:52:32 petterei Exp $
 */
public class RootProjectSystemWrapper extends ClientSystemWrapper<ProjectWrapper> implements ModelSystem<ProjectWrapper> , DNDTarget {
	
	private List<ViewerAction> actionList;
	
	protected RootProjectSystemWrapper(RequirementSystem system) {
		super(system, "Projects", -3, "getProjects", "hasChildren", null);
	}

	@Override
	public List<ViewerAction> getMenuItemActions() {
		if (null == actionList) {
			actionList = new ArrayList<ViewerAction> ();
			actionList.add(new CreateProjectAction(this));
		}
		return actionList;
	}

	/**
	 * Could move this to <tt>ClientSystemWrapper</tt>..
	 * 
	 * @param type
	 * @return
	 */
	public boolean validTransfer(IPropertiesContainer type) {
		return type instanceof ProjectWrapper;
	}
	
	
}

